<template>
  <div class="success-box">
    <TitleBar title="提交成功" :backFunction="goBack"></TitleBar>
    <div class="success-icon">
      <img src="../../assets/img/add-success.png" alt="">
    </div>
    <p>已经成功提交意见反馈，请<br>耐心等待。</p>
    <section class="code-box" v-if="wxqr">
      <div class="pic">
        <img :src="wxqr" alt="识别二维码">
      </div>
      <p>长按识别二维码<br>随时随地联系微信客服</p>
    </section>
    <SuccessFooter></SuccessFooter>
  </div>
</template>
<script>
import TitleBar from '../../components/TitleBar'
import SuccessFooter from '../../components/SuccessFooter'
import { mapState } from 'vuex'
export default {
  components: {
    TitleBar,
    SuccessFooter
  },
  data() {
    return {
    }
  },
  computed: {
    ...mapState({
      wxqr: s => s.serviceInfo.wxqr
    })
  },
  methods: {
    goBack() {
      if (this.$route.query.formPath) {
        this.$router.replace(this.$route.query.formPath + '?catid=' + this.$route.query.catid)
      } else {
        this.$router.replace('/?catid=' + this.$route.query.catid)
      }
    }
  }
}
</script>
<style lang='scss' scoped>
.success-box {
  background: #fff;
  height: 100vh;
  position: relative;
  .success-icon {
    margin: 0.6rem auto 0.4rem;
    text-align: center;
    img {
      width: 2.3rem;
      height: auto;
    }
  }
  p {
    font-size: 0.3rem;
    font-weight: bold;
    color: rgba(51, 51, 51, 1);
    line-height: 0.5rem;
    text-align: center;
  }
  .code-box {
    .pic {
      width: 2.5rem;
      height: 2.5rem;
      margin: 0.3rem auto 0;
      img {
        padding: 0.3rem;
        width: 100%;
        height: 100%;
      }
    }
    p {
      font-size: 0.28rem;
      line-height: 0.42rem;
      text-align: center;
      font-weight: 500;
      color: rgba(153, 153, 153, 1);
    }
  }
}
</style>
